Learn R Programming

NMF (version 0.5.06)

Handling the results of multiple NMF runs: Handling Results from Multiple NMF Runs

Description

The NMF package provides an easy way to perform multiple runs of a given NMF algorithm on a target matrix.

The result from the nmf method is a NMFfitX object that holds either all or only the best run, depending on the running options:

# keep only the best run} object <- nmf(X, r, nrun=20) # keep all the runs} object <- nmf(X, r, nrun=20, .options='k')

The methods documented here are used to handle such results. They are usually independent of the type of result and can be used without change in either situation (all runs kept or only the best one).

Note that when only the best result is kept, the result object conveniently inherits from all the methods available for single runs. Therefore it can be handled as if it had been computed by a single NMF run and all the methods defined for such results can be used (cf. NMFfit and NMF-utils).

See NMFfitXn and NMFfitX1 for details on the classes that implement respectively the case where all the runs are kept and only the best run is kept.

consensus(object, ...)

cophcor(object, ...)

dispersion(object, ...)

## S3 method for class 'NMFfitX': fit(object)

nrun(object, ...)

## S3 method for class 'NMFfitX': metaHeatmap(object, ...)

## S3 method for class 'NMFfitXn': predict(object, ...)

## S3 method for class 'NMFfitX': runtime.all(object)

## S3 method for class 'NMFfitXn': runtime.all(object, null=FALSE, warning=TRUE)

seqtime(object, ...)

## S3 method for class 'NMFfitX': summary(object, ...)

null{ used in method runtime.all for NMFfitXn objects to specify if the result should be NULL when the object has no time data is stored the total computation time. In this case, if null=FALSE (default), the method returns the sequential time (cf. seqtime below) instead of NULL. It also emits a warning which can be toggle with argument warning. } object{ A matrix or an object that inherits from class NMFfitX or NMFfit -- depending on the method. } warning{ used in method runtime.all for NMFfitXn objects to specify if a warning should be emitted when the object has no time data the total computation time and the sequential time is returned instead of NULL (cf. argument null). } ...{ Used to pass extra arguments to subsequent calls:

}

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

NMFfitX1, NMFfitXn, summary

Metagenes and molecular pattern discovery using matrix factorization Brunet, J.~P., Tamayo, P., Golub, T.~R., and Mesirov, J.~P. (2004) Proc Natl Acad Sci U S A 101(12), 4164--4169.

Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis Kim, H. & Park, H. (2007) Bioinformatics. http://dx.doi.org/10.1093/bioinformatics/btm134.

[object Object]

# generate a synthetic dataset with known classes: 50 features, 18 samples (5+5+8) n <- 50; counts <- c(5, 5, 8); V <- syntheticNMF(n, counts, noise=TRUE) metaHeatmap(V)

# build the class factor groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))

# perform multiple runs of NMF (keep best only) res <- nmf(V, 3, nrun=5) res

# compute summary measures summary(res)

# compute more summary measures summary(res, target=V, class=groups)

# plot a heatmap of the consensus matrix with extra annotations metaHeatmap(res, class=groups)

# retrieve the predicted clusters of samples predict(res)

# perform multiple runs of NMF and keep all the runs res <- nmf(V, 3, nrun=5, .options='k') res

# extract best fit fit(res)

# compute/show computational times runtime.all(res) seqtime(res)

Arguments